package org.fastsyncer.common.entity;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 驱动映射关系
 * 
 * @ClassName: MappingTask
 * @Description: 驱动映射配置，支持1对N驱动同步，主要包含数据源和多个目标源驱动
 * @author AE86
 * @date: 2017年7月12日 下午1:48:40
 */
public class MappingTask extends Task implements Serializable {

    private static final long serialVersionUID = 458010454337723960L;

    // 数据源驱动（当前）
    private Mapping sourceMapping;

    // 目标源驱动（当前）
    private Mapping targetMapping;

    // 过滤条件
    // "and":[{"name":"ID","operator":"equal","value":"111"},{"name":"ID","operator":"notEqual","value":"222"}]
    private Map<String, List<Map<String, String>>> query;

    // 策略
    private Map<String, Map<String, String>> policy;

    public Mapping getSourceMapping() {
        return sourceMapping;
    }

    public void setSourceMapping(Mapping sourceMapping) {
        this.sourceMapping = sourceMapping;
    }

    public Mapping getTargetMapping() {
        return targetMapping;
    }

    public void setTargetMapping(Mapping targetMapping) {
        this.targetMapping = targetMapping;
    }

    public Map<String, List<Map<String, String>>> getQuery() {
        return query;
    }

    public void setQuery(Map<String, List<Map<String, String>>> query) {
        this.query = query;
    }

    public Map<String, Map<String, String>> getPolicy() {
        return policy;
    }

    public void setPolicy(Map<String, Map<String, String>> policy) {
        this.policy = policy;
    }

    @Override
    public String toString() {
        return new StringBuilder().append("MappingTask [sourceMapping=").append(sourceMapping)
                .append(", targetMapping=").append(targetMapping)
                .append(", query=").append(query)
                .append(", policy=").append(policy).append("]").toString();
    }

}
